package svc

import (
	"e4ting/internal/config"
	"e4ting/internal/model"
)

type ServiceContext struct {
	Config config.Config
	TypeModel  model.TypesModel
	MoneyModel model.MoneysModel
	UtxoModel  model.UtxoModel
	DayModel   model.DaysModel
	MonthModel model.MonthModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	db := model.InitDB(c.Dsn)
	return &ServiceContext{
		Config: c,
		TypeModel : model.NewTypesModel(db),
		MoneyModel: model.NewMoneysModel(db),
		UtxoModel : model.NewUtxoModel(db),
		DayModel  : model.NewDaysModel(db),
		MonthModel: model.NewMonthModel(db),
	}
}
